﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Zeny.Common.Utils
{
    public class TypeConverterUtils
    {
        public static string bytesToString(byte[] bs)
        {
            if (bs == null)
            {
                return null;
            }

            UTF8Encoding encoding = new UTF8Encoding();
            string s = encoding.GetString(bs);
            return (s);
        }

        public static byte[] stringToBytes(String s)
        {
            if (s == null)
            {
                return null;
            }

            UTF8Encoding encoding = new UTF8Encoding();
            byte[] bs = encoding.GetBytes(s);
            return (bs);
        } 
    }
}
